using System;
using System.Windows.Data;
using System.Globalization;

namespace Locator.Silverlight.Client.Converters
{
    public class AddButtonContentConverter : IValueConverter
    {

        #region IValueConverter Members

        public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
        {
            string result;
            if (value != null)
            {
                bool usedByUser = (bool)value;
                result = usedByUser ? Properties.Resources.AddedCaption : Properties.Resources.AddCaption;
            }
            else
            {
                result = Properties.Resources.AddedCaption;
            }

            return result;
        }

        public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
        {
            throw new NotImplementedException();
        }

        #endregion
    }
}
